//
//  EncodeH264Manner.h
//  VideoChat
//
//  Created by user on 2019/3/20.
//  Copyright © 2019 烧烤有点辣. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <VideoToolbox/VideoToolbox.h>

NS_ASSUME_NONNULL_BEGIN

@protocol H264EncoderDelegate <NSObject>

- (void)gotSpsPps:(NSData*)sps pps:(NSData*)pps ByteHeader:(NSData *)byteHeader ;

- (void)gotEncodedData:(NSData*)data ByteHeader:(NSData *)byteHeader isKeyFrame:(BOOL)isKeyFrame;

@end

@interface EncodeH264Manner : NSObject

@property (weak, nonatomic) id<H264EncoderDelegate> delegate;

- (void)initVideoToolBoxWithWidth:(CGFloat)width height:(CGFloat)height;

- (void)encode:(CMSampleBufferRef)sampleBuffer;

@end

NS_ASSUME_NONNULL_END
